package com.linxz.framework.view;


import android.os.Bundle;
import android.view.View;

import com.linxz.framework.R;
import com.linxz.framework.base.BaseMVPActivity;
import com.linxz.framework.presenter.UserPresenter;
public class MainActivity extends BaseMVPActivity<UserPresenter> implements UserView {
    @Override
    protected UserPresenter createPresenter() {
        return new UserPresenter(this,lifecycleSubject);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
         setContentView(R.layout.act_main);
         initUI();
         initData();
    }

    @Override
    protected void initUI() {
        findViewById(R.id.btnTEst).setOnClickListener(v -> {
            showLoading("");
            mvpPresenter.login("18511747597","123456");
        });
    }

    @Override
    protected void initData() {

    }

    @Override
    public void loginSuccess() {
        hideLoading();
        showToast("登录成功");
    }

    @Override
    public void loginError(String message) {
         hideLoading();
         showToast(message);
    }
}
